Skip to content

Conversation

@chrisdennis
Copy link
Contributor

@chrisdennis chrisdennis commented Jan 28, 2025

Fixes applied are:

  • move new URL(...) to new URI(...).toUrl()
  • move Assert.assertThat(...) to MatcherAssert.assertThat(...)
  • move ExpectedException to Assert.assertThrows(...) use manual code since Guava version changes cause the code to see both 4.12 and 4.13.1 JUnit versions.
  • in all other cases either propagate the deprecation or suppress it.

@chrisdennis chrisdennis force-pushed the calcite-5136 branch 2 times, most recently from 0435ac9 to 9ac4eb7 Compare February 11, 2025 14:48
@stoty
Copy link
Contributor

stoty commented Feb 11, 2025

move ExpectedException to Assert.assertThrows(...) use manual code since Guava version changes cause the code to see both 4.12 and 4.13.1 JUnit versions.

Are you sure ? We're dependency managing Junit to 4.12 , and I could not find 4.13.1 in the gradle dependecy output anywhere ?

We should upgrade to 4.13.2 anyway (in a different JIRA)

@chrisdennis
Copy link
Contributor Author

Are you sure ? We're dependency managing Junit to 4.12 , and I could not find 4.13.1 in the gradle dependecy output anywhere ?

I could have sworn this failed locally for me... but now I can't reproduce that failure. I've pulled that change and pushed. Let's see what CI makes of it now.

private static boolean isKdcStarted = false;
private static boolean isHttpServerStarted = false;

private static URL httpServerUrl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should update the names in these cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed the rename. I think this was the only case where we changed the type.

@chrisdennis
Copy link
Contributor Author

FYI: I pounded on the test that failed on macOS locally and see the following pattern:

Failure Statistics
49976 : connection refused
24 : connection reset

The existing code doesn't account for "connection reset". I have a fix for this... does it need a JIRA issue, and a separate PR?

@stoty
Copy link
Contributor

stoty commented Feb 11, 2025

Thank you.

Preferably yes. CALCITE-6799 already exists for the issue.

filePath += "/";
}
try {
// We need to encode path. For instance, " " should become "%20"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:
Is this comment still needed ?

Copy link
Contributor Author

@chrisdennis chrisdennis Feb 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, probably not. Removed... but closer inspection here forced me to fix something else. This branch of the code is making a very "odd" URI/URL. It's a hierarchical URI, with a relative path and a scheme. I don't know if they're illegal under the RFC... but it's certainly weird. I had to subtly tweak things here to construct one by treating it as a non-heirarchical URL (args here are: scheme, scheme-specific-part, fragment). The behavior now matches the old code.

Copy link
Contributor

@stoty stoty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 LGTM

@rubenada
Copy link
Contributor

This PR looks in a good shape, shall we move on?
One minor detail though, per our contribution guidelines, commit messages should not end with a period; apart from that I think generally we tend to use as final commit message the Jira title, i.e. [CALCITE-5136] Avatica build (or CI) must fail if there are deprecation warnings in this case.

@chrisdennis chrisdennis changed the title [CALCITE-5136] Elevate deprecation warnings to error and handle resultant failures. [CALCITE-5136] Avatica build (or CI) must fail if there are deprecation warnings Feb 13, 2025
@chrisdennis
Copy link
Contributor Author

One minor detail though, per our contribution guidelines, commit messages should not end with a period; apart from that I think generally we tend to use as final commit message the Jira title, i.e. [CALCITE-5136] Avatica build (or CI) must fail if there are deprecation warnings in this case.

Fixed.

@chrisdennis
Copy link
Contributor Author

chrisdennis commented Feb 13, 2025

@stoty something is up in CI... the force push didn't change anything: https://github.com/apache/calcite-avatica/compare/da93125c4a177717611beb1db0b51f3bf279e390..fd947c724f8a46ec45f5126adcefdeb4868e25eb

Yet somehow everything is now failing... and it looks like it's because the build resolved 4.13.x of JUnit (evidenced in all the assertThat(...) deprecation warnings).

Should have rebased... missed that you updated to 4.13.2. Will adjust accordingly

@F21 F21 force-pushed the main branch 7 times, most recently from 8f21bf5 to 4d3aaac Compare February 17, 2025 01:08
.idea/vcs.xml Outdated
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
<component name="CommitMessageInspectionProfile">
Copy link
Contributor

@stoty stoty Feb 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to include this @chrisdennis ?

It doesn't seem related to the deprecations.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not... I guess IntelliJ got over-eager with the reformatting and I did an ill-advised git add ..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted.

…on warnings

Fixes applied are:
 * move `new URL(...)` to `new URI(...).toUrl()`
 * move `Assert.assertThat(...)` to `MatcherAssert.assertThat(...)`
 * move `ExpectedException` to `Assert.assertThrows(...)`
 * in all other cases either propagate the deprecation or suppress it.
@stoty
Copy link
Contributor

stoty commented Feb 18, 2025

merged manually.

@stoty stoty closed this Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants